home *** CD-ROM | disk | FTP | other *** search
- #define FALSE (0)
- #define TRUE (!FALSE)
-
- #define PROC_ID 128
- #define FIRST_ICON_ID 129
- #define ERASE_ICON_ID 128
- /* (used to “erase” the first icon) */
- #define FINAL_ICON_ID 130
- #define OLD_MENUSELECT 0xA93d
- int main(void);
-
- /*********************** Main *********/
-
- int main(void)
- {
- Handle HCodeRes;
- long LIgnoreResult;
-
- Handle HProc;
-
- /* Load the ShowIcon PROC resource */
- if ((HProc = GetResource('PROC', PROC_ID)) != 0L)
- {
- HLock(HProc);
- CallPascal(FIRST_ICON_ID, 0, *HProc);
- HUnlock(HProc);
- }
-
-
- if ((HCodeRes=GetResource('jpat',128)) != 0L)
- {
- DetachResource(HCodeRes);
- /* This is in the system heap so you don’t really want it high
- however MoveHHi currently does nothing in the system and will
- eventually move low. Or so says Apple. */
- MoveHHi(HCodeRes);
- HLock(HCodeRes);
- };
-
- /* get the old MenuSelect Trap and put it into the header or code segment*/
- (*((long **)HCodeRes))[3]=GetTrapAddress(OLD_MENUSELECT);
-
- SetTrapAddress((long)*HCodeRes,OLD_MENUSELECT); /* Menu Select */
- Delay(20,&LIgnoreResult); /* to improve the animation of ShowIcon, but
- at the cost of 1/3 of a second of machine boot
- time. */
- if ((HProc = GetResource('PROC', PROC_ID)) != 0L)
- {
- HLock(HProc);
- CallPascal(ERASE_ICON_ID, 0, *HProc);
- CallPascal(FINAL_ICON_ID, -1, *HProc);
- HUnlock(HProc);
- }
- }
-
-
-
-